<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>完善个人信息</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/member.css"/>
    <script type="text/javascript" src="../../script/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../../script/mobile.js"></script>
    <script type="text/javascript">
        window['adaptive'].desinWidth = 750;
        window['adaptive'].baseFont = 28;
        window['adaptive'].maxWidth = 750;
        window['adaptive'].init();
    </script>
</head>

<body>
<div id="header" style="height: 0.9rem; background: #fff; position: fixed; top: 0;left: 0; width: 100%; z-index: 99">
    <header class="header header-shadow">
        <div class="header-left">
            <div tapmode onclick="comeBack();" class="nav-left"><img class="icon-back" src="../../icon/icon-back.png"/>
            </div>
        </div>
        <h2>学生认证</h2>
    </header>
</div>
<div class="header-h" style="padding-top: 1.5rem;"></div>
<section class="html_section pr30 pl30 pb40 perfect_box">
    <div class="perfect_carams">
        <div class="carams_box">
            <img src="../../icon/icon-media.png"/>
            <div class="c-666 f30 mt10">拍照/照片</div>
            <div class="info-info" tapmode onclick="upload()">
                <img id="infoImg" src="" alt="">
            </div>
        </div>
    </div>
    <!--<div style="width: 5rem;margin:0 auto;"><input type="text" class="ipnut_css2" id="number" placeholder="请输入学号"/>-->
    </div>
    <div class="f30 mt30 t-c">认证校园信息</div>
    <p class="t-c f22 c-999 mt30">Uni温馨提示：为保证情报局的纯粹性，请所有小伙伴完成本次认证，上传的资料可以是：学生证、校园卡、录取通知书、高考准考证、毕业证书（毕业一年内）</p>
    <div class="btn1 mt75" tapmode onclick="submitData()">确定</div>
    <div class="btn2 mt20">跳过</div>
</section>
<section class="mask_pop">
    <div class="mask"></div>
    <div class="msg_pop2 pop" style="display: none;">
        <div class="msg_pop_title">提示</div>
        <div class="msg_pop_content">完成学生认证可以解锁专属学校板块和更多功能哦~确定要跳过吗？</div>
        <div class="flex_center pb30">
            <div class="btn7 mr30" onclick="popClose(1);">暂不认证</div>
            <div class="btn6" onclick="popClose(2);">立即认证</div>
        </div>
    </div>
</section>
</body>

</html>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript">

    var img_ids = '';//上传图片id
    apiready = function () {
        setFixStatusBar(); //设置状态栏
        keybackListener()
        api.addEventListener({
            name: 'closeCurrWinIndex'
        }, function (ret, err) {
            api.closeWin();
        });

    };

    //上传头像
    function upload() {
        uploadHeadPic(function (res) {
            $("#infoImg").attr('src', ajaxUrl + res.path);
            img_ids = res.icon;
        })
    }

    //提交信息
    function submitData() {
        var param = {
            token: $api.getStorage('token'),
            type: 2,//类型：1为完善信息 2为学生认证
            attestation_ids: img_ids,
            // number: $("#number").val()
        };
        // if (!isDefine(param.number)) {
        //     pop.notice('请填写学号', 2);
        //     return;
        // }
        if (!isDefine(param.attestation_ids)) {
            pop.notice('请上传认证资料', 2);
            return;
        }
        pop.loading();
        getAjax(Interface.set_member, param, function (res) {
            console.log(JSON.stringify(res))
            pop.close();
            commonUrl('choose_interest')
        },function (error) {
            console.log(JSON.stringify(error));
            pop.close();
        })

    }


    $(".btn2").click(function () {
        $(".mask").show();
        $(".mask_pop").addClass("on");
        $(".msg_pop2").show();
    });

    function popClose(type) {

        if(type==1){
            commonUrl('choose_interest')
        }
        $(".mask").hide();
        $(".mask_pop").removeClass("on");
    }

</script>
